# -*- coding:utf-8 -*-
# time: 2025/7/26 ♡  22:33
# author:张伟
from flask import Blueprint, send_from_directory, current_app

bp = Blueprint("media", __name__, url_prefix="/media")

@bp.route("/avatar/<filename>")
def get_avatar(filename):
    return send_from_directory(current_app.config["AVATARS_SAVE_PATH"], filename)


@bp.route("/post/<filename>")
def get_post_image(filename):
    return send_from_directory(current_app.config["IMAGE_SAVE_PATH"], filename)


@bp.route("/banner/<filename>")
def get_banner_image(filename):
    return send_from_directory(current_app.config["BANNER_IMAGE_SAVE_PATH"], filename)